The processing of individual tasks of a control program in a cooperative mode means that, in response to differently prioritized tasks, a higher prioritized task to be executed leads to the interruption of a lower prioritized task being executed at the moment. Differently from preemptive mode, in which a higher prioritized task to be executed interrupts a process of a lower prioritized task being executed at the moment, in the cooperative mode, the higher prioritized task awaits the end of the process of the lower prioritized task being executed at the moment. Only then is the lower prioritized task interrupted, and the higher prioritized task is executed. When the higher prioritized task is completed, the lower prioritized task is continued at the process before which it was interrupted.
The processing of tasks of a control program in cooperative mode is known from German Published Patent Application No. 195 00 957. The interruption of a lower prioritized task by a higher prioritized task belongs to the objects of a multitasking operating system. Such a multitasking operating system, which supports the cooperative mode as well as the preemptive mode in the execution of control programs is, for example, the real time operating system ERCOSEK of the firm ETAS, Entwicklungs- und Applikationswerkzeuge für elektronische System (Development and Application Tools for Electronic Systems) GmbH & Co. KG, Stuttgart, Germany, (cf ETAS GmbH & Co. KG: ERCOSEK V2.0.0 Manual, Stuttgart, 1998). Specific reference is made to German Published Patent Application No 195 00 957 and the ERCOSEK handbook.
The running time of the processes fluctuates according to the loading of the computing element. For this reason, and for reasons of the possible interruptions caused by other, higher prioritized tasks, the sequence of process calls can be different for multiple executions of one and the same control program. That means that, after the execution of the control program, the exact sequence of process calls is not known, and also cannot be reconstructed, for example, for simulation purposes.
Various methods are known for the simulation of a control program, or of parts thereof (algorithm). A subsequent simulation of an algorithm or of the control program, using measured data, is denoted as offline open loop simulation (OOL). A so-called offline closed loop simulation (OCL) concerns simulation of an algorithm or of the control program with a simulation model in a closed simulation loop. The lacking reproducibility of the sequence of the executed processes leads to considerable difficulties, in particular in the case of a subsequent simulation of the algorithm using measured data (OOL).
According to the related art, algorithms which are controlled by a multitasking operating system are usually simulated in an optimum state. That means that the individual tasks of the control program are called up in such a way that no interruption takes place.
In German Published Patent Application No. 195 00 957 it is mentioned that the simulation of a control program to be executed in the cooperative mode has advantages over the simulation of a program to be executed in the preemptive mode, since the time sequence of program execution and the effect of interruptions can be simulated.
That is possible without further consideration because the individual processes are not interrupted in the cooperative mode, and the number of variables describing the program, which variables are stored in a stack storage, is constant. Thereby, the interruptions between the processes can be very well simulated during the development phase, since the number of possibilities of an interruption is limited, and the interruptions are independent of the program sequence.
Because of the lack of reproducibility of the process sequence subsequently to an actual processing of a control program, all simulations, known from the related art, of algorithms of a control program to be processed in a cooperative or in a preemptive mode have the disadvantage that a simulation under real conditions is not possible.